/**
 * 
 *  Este arquivo é parte do programa TODO Ver nome. TODO Ver nome é um software livre; você pode redistribui-lo e/ou 
 *  modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela Fundação do Software Livre (FSF); 
 *  na versão 2 da Licença, ou (na sua opnião) qualquer versão.
 *  
 *	Este programa é distribuido na esperança que possa ser útil, mas SEM NENHUMA GARANTIA; sem uma garantia implicita
 *  de ADEQUAÇÂO a qualquer MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes.
 *	Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este programa, se não, escreva para a Fundação do
 *	Software Livre(FSF) 
 *
 *	Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 */

package fullcalc.gui;

import fullcalc.comum.enums.OperacaoSelecionada;
import fullcalc.comum.util.CalculadorGUIUtil;

/*
 * Projeto Calculadora Beta - Criação: 29/04/2013 - 14:40
 * 
 */

/**
 * <p>
 * Classe GUI que representa a janela apresentada o usuário da calculadora
 * </p>
 * 
 * @author Willyan Guimarães Caetano
 * @version 0.1
 * 
 *          TODO Corrigir posição dos botões na janela TODO Implementar botões
 *          não implementados TODO Validar tamanho do campo que não pode passar
 *          de 8 posições TODO Implementar processo de resultado eventos demais
 *          classes TODO Continuar os comentários
 */
public class CalculadorGUI extends javax.swing.JFrame {

	private RegistradorEventos listenerControle;

	/**
	 * Método Construtor da classe
	 */
	public CalculadorGUI() {
		initComponents();
		desativaBotoesNaoImplementados();
		insereValidacoesCampo();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	@SuppressWarnings("unchecked")
	// <editor-fold defaultstate="collapsed"
	// desc="Generated Code">//GEN-BEGIN:initComponents
	private void initComponents() {

		campoCalculadora = new javax.swing.JTextField();
		btnSete = new javax.swing.JButton();
		btnOito = new javax.swing.JButton();
		btnNove = new javax.swing.JButton();
		btnDivisao = new javax.swing.JButton();
		btnDesfazer = new javax.swing.JButton();
		btnDeletar = new javax.swing.JButton();
		btnQuatro = new javax.swing.JButton();
		btnCinco = new javax.swing.JButton();
		btnSeis = new javax.swing.JButton();
		btnMultiplicacao = new javax.swing.JButton();
		btnParentesesAbre = new javax.swing.JButton();
		btnParentesesFecha = new javax.swing.JButton();
		btnRaiz = new javax.swing.JButton();
		btnPotencia = new javax.swing.JButton();
		btnSubtracao = new javax.swing.JButton();
		btnTres = new javax.swing.JButton();
		btnDois = new javax.swing.JButton();
		btnUm = new javax.swing.JButton();
		btnResultado = new javax.swing.JButton();
		btnZero = new javax.swing.JButton();
		btnMais = new javax.swing.JButton();
		btnPorcentagem = new javax.swing.JButton();
		btnVirgula = new javax.swing.JButton();

		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
		setTitle("Calculadora");
		addKeyListener(new java.awt.event.KeyAdapter() {
			public void keyPressed(java.awt.event.KeyEvent evt) {
				formKeyPressed(evt);
			}
		});

		campoCalculadora.setFont(new java.awt.Font("Monospaced", 2, 24)); // NOI18N

		btnSete.setText("7");
		btnSete.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnSeteActionPerformed(evt);
			}
		});

		btnOito.setText("8");
		btnOito.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnOitoActionPerformed(evt);
			}
		});

		btnNove.setText("9");
		btnNove.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnNoveActionPerformed(evt);
			}
		});

		btnDivisao.setText("/");
		btnDivisao.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnDivisaoActionPerformed(evt);
			}
		});

		btnDesfazer.setText("DESF");

		btnDeletar.setText("DEL");
		btnDeletar.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnDeletarActionPerformed(evt);
			}
		});

		btnQuatro.setText("4");
		btnQuatro.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnQuatroActionPerformed(evt);
			}
		});

		btnCinco.setText("5");
		btnCinco.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnCincoActionPerformed(evt);
			}
		});

		btnSeis.setText("6");
		btnSeis.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnSeisActionPerformed(evt);
			}
		});

		btnMultiplicacao.setText("x");

		btnParentesesAbre.setText("(");

		btnParentesesFecha.setText(")");

		btnRaiz.setText("raiz x");

		btnPotencia.setText("x²");

		btnSubtracao.setText("-");
		btnSubtracao.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnSubtracaoActionPerformed(evt);
			}
		});

		btnTres.setText("3");
		btnTres.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnTresActionPerformed(evt);
			}
		});

		btnDois.setText("2");
		btnDois.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnDoisActionPerformed(evt);
			}
		});

		btnUm.setText("1");
		btnUm.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnUmActionPerformed(evt);
			}
		});

		btnResultado.setText("=");
		btnResultado.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnResultadoActionPerformed(evt);
			}
		});

		btnZero.setText("0");
		btnZero.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnZeroActionPerformed(evt);
			}
		});

		btnMais.setText("+");
		btnMais.addActionListener(new java.awt.event.ActionListener() {
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				btnMaisActionPerformed(evt);
			}
		});

		btnPorcentagem.setText("%");

		btnVirgula.setText(",");

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(
				getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addContainerGap()
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.LEADING)
												.addComponent(campoCalculadora)
												.addGroup(
														layout.createSequentialGroup()
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						btnSete,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						btnQuatro,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE))
																.addGap(4, 4, 4)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																				.addComponent(
																						btnCinco,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						78,
																						Short.MAX_VALUE)
																				.addComponent(
																						btnOito,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE))
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						btnNove,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						btnSeis,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE))
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING)
																				.addGroup(
																						layout.createSequentialGroup()
																								.addGap(7,
																										7,
																										7)
																								.addComponent(
																										btnMultiplicacao,
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										Short.MAX_VALUE))
																				.addGroup(
																						layout.createSequentialGroup()
																								.addPreferredGap(
																										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																								.addComponent(
																										btnDivisao,
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										Short.MAX_VALUE)))
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																				.addComponent(
																						btnParentesesAbre,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						72,
																						Short.MAX_VALUE)
																				.addComponent(
																						btnDesfazer,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE))
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																				.addComponent(
																						btnParentesesFecha,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						btnDeletar,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						72,
																						Short.MAX_VALUE)))
												.addGroup(
														layout.createSequentialGroup()
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING,
																				false)
																				.addComponent(
																						btnUm,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						78,
																						Short.MAX_VALUE)
																				.addComponent(
																						btnZero,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE))
																.addGap(4, 4, 4)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						btnDois,
																						javax.swing.GroupLayout.PREFERRED_SIZE,
																						76,
																						javax.swing.GroupLayout.PREFERRED_SIZE)
																				.addComponent(
																						btnVirgula,
																						javax.swing.GroupLayout.PREFERRED_SIZE,
																						76,
																						javax.swing.GroupLayout.PREFERRED_SIZE))
																.addGap(8, 8, 8)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						btnPorcentagem,
																						javax.swing.GroupLayout.PREFERRED_SIZE,
																						79,
																						javax.swing.GroupLayout.PREFERRED_SIZE)
																				.addComponent(
																						btnTres,
																						javax.swing.GroupLayout.PREFERRED_SIZE,
																						79,
																						javax.swing.GroupLayout.PREFERRED_SIZE))
																.addGap(8, 8, 8)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.LEADING)
																				.addComponent(
																						btnSubtracao,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						Short.MAX_VALUE)
																				.addComponent(
																						btnMais,
																						javax.swing.GroupLayout.DEFAULT_SIZE,
																						78,
																						Short.MAX_VALUE))
																.addPreferredGap(
																		javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																.addGroup(
																		layout.createParallelGroup(
																				javax.swing.GroupLayout.Alignment.TRAILING,
																				false)
																				.addGroup(
																						layout.createSequentialGroup()
																								.addComponent(
																										btnPotencia,
																										javax.swing.GroupLayout.PREFERRED_SIZE,
																										72,
																										javax.swing.GroupLayout.PREFERRED_SIZE)
																								.addPreferredGap(
																										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																								.addComponent(
																										btnRaiz,
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										javax.swing.GroupLayout.DEFAULT_SIZE,
																										Short.MAX_VALUE))
																				.addComponent(
																						btnResultado,
																						javax.swing.GroupLayout.PREFERRED_SIZE,
																						150,
																						javax.swing.GroupLayout.PREFERRED_SIZE))))
								.addContainerGap()));
		layout.setVerticalGroup(layout
				.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
				.addGroup(
						layout.createSequentialGroup()
								.addGap(23, 23, 23)
								.addComponent(campoCalculadora,
										javax.swing.GroupLayout.PREFERRED_SIZE,
										50,
										javax.swing.GroupLayout.PREFERRED_SIZE)
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(btnSete)
												.addComponent(btnOito)
												.addComponent(btnNove)
												.addComponent(btnDivisao)
												.addComponent(btnDesfazer)
												.addComponent(btnDeletar))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(btnQuatro)
												.addComponent(btnCinco)
												.addComponent(btnSeis)
												.addComponent(btnMultiplicacao)
												.addComponent(btnParentesesAbre)
												.addComponent(
														btnParentesesFecha))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(btnUm)
												.addComponent(btnDois)
												.addComponent(btnTres)
												.addComponent(btnSubtracao)
												.addComponent(btnPotencia)
												.addComponent(btnRaiz))
								.addPreferredGap(
										javax.swing.LayoutStyle.ComponentPlacement.RELATED)
								.addGroup(
										layout.createParallelGroup(
												javax.swing.GroupLayout.Alignment.BASELINE)
												.addComponent(btnZero)
												.addComponent(btnVirgula)
												.addComponent(btnPorcentagem)
												.addComponent(btnMais)
												.addComponent(btnResultado))
								.addContainerGap(
										javax.swing.GroupLayout.DEFAULT_SIZE,
										Short.MAX_VALUE)));

		pack();
	}// </editor-fold>//GEN-END:initComponents

	private void btnSeteActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnSeteActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.SETE, campoCalculadora));
	}// GEN-LAST:event_btnSeteActionPerformed

	private void btnOitoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOitoActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.OITO, campoCalculadora));
	}// GEN-LAST:event_btnOitoActionPerformed

	private void btnNoveActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnNoveActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.NOVE, campoCalculadora));
	}// GEN-LAST:event_btnNoveActionPerformed

	private void btnQuatroActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnQuatroActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.QUATRO, campoCalculadora));
	}// GEN-LAST:event_btnQuatroActionPerformed

	private void btnCincoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnCincoActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.CINCO, campoCalculadora));
	}// GEN-LAST:event_btnCincoActionPerformed

	private void btnSeisActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnSeisActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.SEIS, campoCalculadora));
	}// GEN-LAST:event_btnSeisActionPerformed

	private void btnUmActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnUmActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.UM, campoCalculadora));
	}// GEN-LAST:event_btnUmActionPerformed

	private void btnDoisActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnDoisActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.DOIS, campoCalculadora));
	}// GEN-LAST:event_btnDoisActionPerformed

	private void btnTresActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnTresActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.TRES, campoCalculadora));
	}// GEN-LAST:event_btnTresActionPerformed

	private void btnZeroActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnZeroActionPerformed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.ZERO, campoCalculadora));
	}// GEN-LAST:event_btnZeroActionPerformed

	private void formKeyPressed(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_formKeyPressed
		campoCalculadora.setText(CalculadorGUIUtil.processaInsercaoValorCampo(
				CalculadorGUIUtil.verificaTeclaPressionada(evt),
				campoCalculadora));
	}// GEN-LAST:event_formKeyPressed

	private void btnMaisActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnMaisActionPerformed
		listenerControle.registraOperacaoSelecionada(
				campoCalculadora.getText(), OperacaoSelecionada.ADICAO);
	}// GEN-LAST:event_btnMaisActionPerformed

	private void btnResultadoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnResultadoActionPerformed
		listenerControle.solicitaResultadoOperacao(campoCalculadora.getText());
	}// GEN-LAST:event_btnResultadoActionPerformed

	private void btnDivisaoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnDivisaoActionPerformed
		executaLimpezaCampoERetornoDeFoco();
	}// GEN-LAST:event_btnDivisaoActionPerformed

	private void btnSubtracaoActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnSubtracaoActionPerformed
		listenerControle.registraOperacaoSelecionada(
				campoCalculadora.getText(), OperacaoSelecionada.SUBTRACAO);
		executaLimpezaCampoERetornoDeFoco();
	}// GEN-LAST:event_btnSubtracaoActionPerformed

	private void btnDeletarActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnDeletarActionPerformed
		executaLimpezaCampoERetornoDeFoco();
	}// GEN-LAST:event_btnDeletarActionPerformed

	/*
	 * Desativa os botões que não foram implementados
	 */
	private void desativaBotoesNaoImplementados() {
		btnDesfazer.setEnabled(false);
		btnParentesesAbre.setEnabled(false);
		btnParentesesFecha.setEnabled(false);
		btnVirgula.setEnabled(false);
		btnPorcentagem.setEnabled(false);
		btnPotencia.setEnabled(false);
		btnRaiz.setEnabled(false);
	}

	private void insereValidacoesCampo() {
		campoCalculadora.setDocument(new TextDocument(
				CalculadorGUIUtil.tamanhoMaximoCampo));

		campoCalculadora.addKeyListener(new java.awt.event.KeyAdapter() {
			public void keyReleased(java.awt.event.KeyEvent evt) {
				campoCalculadora.setText(campoCalculadora.getText().replaceAll(
						"[^0-9]", ""));
			}
		});

		campoCalculadora.getCaret().setVisible(false);
	}

	private void executaLimpezaCampoERetornoDeFoco() {
		campoCalculadora.setText("");
		campoCalculadora.requestFocus();
	}

	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String args[]) {
		/* Set the Nimbus look and feel */
		// <editor-fold defaultstate="collapsed"
		// desc=" Look and feel setting code (optional) ">
		/*
		 * If Nimbus (introduced in Java SE 6) is not available, stay with the
		 * default look and feel. For details see
		 * http://download.oracle.com/javase
		 * /tutorial/uiswing/lookandfeel/plaf.html
		 */
		try {
			for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager
					.getInstalledLookAndFeels()) {
				if ("Metal".equals(info.getName())) {
					javax.swing.UIManager.setLookAndFeel(info.getClassName());
					break;
				}
			}
		} catch (ClassNotFoundException ex) {
			java.util.logging.Logger.getLogger(CalculadorGUI.class.getName())
					.log(java.util.logging.Level.SEVERE, null, ex);
		} catch (InstantiationException ex) {
			java.util.logging.Logger.getLogger(CalculadorGUI.class.getName())
					.log(java.util.logging.Level.SEVERE, null, ex);
		} catch (IllegalAccessException ex) {
			java.util.logging.Logger.getLogger(CalculadorGUI.class.getName())
					.log(java.util.logging.Level.SEVERE, null, ex);
		} catch (javax.swing.UnsupportedLookAndFeelException ex) {
			java.util.logging.Logger.getLogger(CalculadorGUI.class.getName())
					.log(java.util.logging.Level.SEVERE, null, ex);
		}
		// </editor-fold>

		/* Create and display the form */
		java.awt.EventQueue.invokeLater(new Runnable() {
			public void run() {
				new CalculadorGUI().setVisible(true);
			}
		});
	}

	// Variables declaration - do not modify//GEN-BEGIN:variables
	private javax.swing.JButton btnCinco;
	private javax.swing.JButton btnDeletar;
	private javax.swing.JButton btnDesfazer;
	private javax.swing.JButton btnDivisao;
	private javax.swing.JButton btnDois;
	private javax.swing.JButton btnMais;
	private javax.swing.JButton btnMultiplicacao;
	private javax.swing.JButton btnNove;
	private javax.swing.JButton btnOito;
	private javax.swing.JButton btnParentesesAbre;
	private javax.swing.JButton btnParentesesFecha;
	private javax.swing.JButton btnPorcentagem;
	private javax.swing.JButton btnPotencia;
	private javax.swing.JButton btnQuatro;
	private javax.swing.JButton btnRaiz;
	private javax.swing.JButton btnResultado;
	private javax.swing.JButton btnSeis;
	private javax.swing.JButton btnSete;
	private javax.swing.JButton btnSubtracao;
	private javax.swing.JButton btnTres;
	private javax.swing.JButton btnUm;
	private javax.swing.JButton btnVirgula;
	private javax.swing.JButton btnZero;
	private javax.swing.JTextField campoCalculadora;
	// End of variables declaration//GEN-END:variables
}
